package com.lframework.xingyun.basedata.vo.product.costcard;

import com.lframework.starter.web.core.vo.BaseVo;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * 更新商品成本卡明细
 *
 * @author zmj
 * @since 2024-01-01
 */
@Data
public class UpdateProductCostCardDetailVo implements BaseVo, Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * ID
   */
  @ApiModelProperty("ID")
  private String id;

  /**
   * 源成分商品ID
   */
  @ApiModelProperty("源成分商品ID")
  private String sourceProductId;

  /**
   * 成分商品ID
   */
  @ApiModelProperty(value = "成分商品ID", required = true)
  @NotBlank(message = "成分商品ID不能为空！")
  private String ingredientProductId;

  /**
   * 消耗单位ID
   */
  @ApiModelProperty(value = "消耗单位ID", required = true)
  @NotBlank(message = "消耗单位ID不能为空！")
  private String unitId;

  /**
   * 消耗数量
   */
  @ApiModelProperty(value = "消耗数量", required = true)
  @NotNull(message = "消耗数量不能为空！")
  @Min(value = 1, message = "消耗数量必须大于0！")
  private Integer consumeQuantity;

  /**
   * 单位成本
   */
  @ApiModelProperty("单位成本")
  private BigDecimal unitCost;

  /**
   * 排序号
   */
  @ApiModelProperty("排序号")
  private Integer orderNo;

  /**
   * 备注
   */
  @ApiModelProperty("备注")
  private String description;

  /**
   * 替换品列表
   */
  @ApiModelProperty("替换品列表")
  private List<ReplacementVo> replacements;

  @Data
  public static class ReplacementVo implements Serializable {
    @ApiModelProperty("替换品商品ID")
    private String ingredientProductId;
    /**
     * 消耗单位ID
     */
    @ApiModelProperty(value = "消耗单位ID", required = true)
    @NotBlank(message = "消耗单位ID不能为空！")
    private String unitId;
    @ApiModelProperty("消耗数量")
    private Integer consumeQuantity;
  }
} 